/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task06.task0621;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/* 
猫之间的关系
*/
public class Solution {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String cat1Name = reader.readLine();
        String cat2Name = reader.readLine();
        String cat3Name = reader.readLine();
        String cat4Name = reader.readLine();
        String cat5Name = reader.readLine();
        String cat6Name = reader.readLine();

        Cat cat1 = new Cat(cat1Name, null, null);
        Cat cat2 = new Cat(cat2Name, null, null);
        Cat cat3 = new Cat(cat3Name, null, cat1Name);
        Cat cat4 = new Cat(cat4Name, cat2Name, null);
        Cat cat5 = new Cat(cat5Name, cat4Name, cat3Name);
        Cat cat6 = new Cat(cat6Name, cat4Name, cat3Name);

        System.out.println(cat1);
        System.out.println(cat2);
        System.out.println(cat3);
        System.out.println(cat4);
        System.out.println(cat5);
        System.out.println(cat6);
    }

    public static class Cat {
        private String name;
        private String father;
        private String monther;

        Cat(String name, String monther, String father) {
            this.name = name;
            this.father = father;
            this.monther = monther;
        }

        @Override
        public String toString() {
            if (monther == null && father != null)
                return "猫的名字为" + name + "，无母亲" + "，" + father + "是父亲";
            else if (monther != null && father == null)
                return "猫的名字为" + name + "，" + monther + "是母亲" + "，无父亲";
            else if (monther != null && father != null)
                return "猫的名字为" + name + "，" + monther + "是母亲" + "，" + father + "是父亲";

            else
                return "猫的名字为" + name + "，无母亲, 无父亲";
        }
    }

}